const eventClass = require('./eventClass');

class osClass extends eventClass {
    constructor() {
        super('osClass');
        this.type = ((type) => {
            type = type.toLowerCase();
            switch (type) {
                case 'darwin':
                    return 'mac';
                case 'linux':
                    return 'linux';
                case 'win32':
                    return 'win';
                default:
                    if (type.indexOf('win') + 1) {
                        return 'win';
                    }
                        // throw new Error('do not support this platform');
                        return 'un';

            }
        })(require('os').platform());
    }

    get(cb) {
        this.returnMethod(cb, {
            data: this.type,
        });
    }
}

module.exports = osClass;

